<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>主应用</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        ul li{
            display: inline-block;
        }
        .normal {
            cursor: pointer;
        }
        .normal.current {
            color:red;
        }
    </style>
</head>
<body>
    <div id="base">
        <ul>
            <li id="op" class="normal" onclick="onChoose('op')">
                运营门户
            </li>
            <li id="np" class="normal" onclick="onChoose('np')">
                客户自服务门户
            </li>
        </ul>
    </div>
</body>
<script>
    function onChoose(type) {
        const content = document.createElement('div');
        base.appendChild(content);
        switch (type) {
            case 'op':
                op.className = 'normal current';
                np.className='normal';
                window.location.href = `#/${type}`
                content.id = type;
                break;
            case 'np':
                op.className = 'normal';
                np.className = 'normal current';
                window.location.href = `#/${type}`;
                content.id = type;
                break;
        }
    }
</script>
</html>